package com.yunche.iov.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.yunche.iov.entity.Device;
import com.yunche.iov.entity.DeviceExample;
import com.yunche.iov.mapper.DeviceMapper;
import com.yunche.iov.service.DeviceManageService;

@Service("deviceService")
@Transactional
public class DeviceServiceImpl implements DeviceManageService {

	@Autowired
	private DeviceMapper deviceManageMapper;

	@Override
	public Integer insertDevice(Device device) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Integer deleteDeviceById(Integer deviceId) {
		// TODO Auto-generated method stub
		return deviceManageMapper.deleteByPrimaryKey(deviceId);
	}

	@Override
	public Integer updateDevice(Device device) {
		// TODO Auto-generated method stub
		return deviceManageMapper.updateByPrimaryKey(device);
	}

	@Override
	public List<Device> findAllDevice() {
		// TODO Auto-generated method stub
		DeviceExample deviceExample = new DeviceExample();
		return deviceManageMapper.selectByExample(deviceExample);
	}

	@Override
	public List<Device> findDeviceByCriteria(Device device) {
		// TODO Auto-generated method stub
		DeviceExample deviceExample = new DeviceExample();
		return deviceManageMapper.selectByExample(deviceExample);
	}

	

}
